package org.design.environmentprotection.application;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import org.design.environmentprotection.manager.SharedPreferencesManager;
import org.design.environmentprotection.util.AppInfoUtils;

public class MyApplication extends Application {

    private static MyApplication app;
    private static Context mContext;
    public static Handler mHandler = new Handler(Looper.getMainLooper());

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        mContext = getApplicationContext();
        String signal = AppInfoUtils.getSingInfo(getApplicationContext(), getPackageName(), AppInfoUtils.SHA1);
    }

    /**
     * 单例模式
     *
     * @return
     */
    public static MyApplication getSingeton() {
        return app;
    }


    /**
     * 返回Application的上下文
     *
     * @return
     */
    public static Context getContext() {
        return mContext;
    }

}
